package com.pzb.goods.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.pzb.goods.mapper.GdGoodsPictureMapper;
import com.pzb.goods.domain.GdGoodsPicture;
import com.pzb.goods.service.IGdGoodsPictureService;

/**
 * 商品图片关联Service业务层处理
 * 
 * @author Mr_Wu
 * @date 2021-11-30
 */
@Service
public class GdGoodsPictureServiceImpl implements IGdGoodsPictureService 
{
    @Autowired
    private GdGoodsPictureMapper gdGoodsPictureMapper;

    /**
     * 查询商品图片关联
     * 
     * @param id 商品图片关联主键
     * @return 商品图片关联
     */
    @Override
    public GdGoodsPicture selectGdGoodsPictureById(Long id)
    {
        return gdGoodsPictureMapper.selectGdGoodsPictureById(id);
    }

    /**
     * 查询商品图片关联列表
     * 
     * @param gdGoodsPicture 商品图片关联
     * @return 商品图片关联
     */
    @Override
    public List<GdGoodsPicture> selectGdGoodsPictureList(GdGoodsPicture gdGoodsPicture)
    {
        return gdGoodsPictureMapper.selectGdGoodsPictureList(gdGoodsPicture);
    }

    /**
     * 新增商品图片关联
     * 
     * @param gdGoodsPicture 商品图片关联
     * @return 结果
     */
    @Override
    public int insertGdGoodsPicture(GdGoodsPicture gdGoodsPicture)
    {
        return gdGoodsPictureMapper.insertGdGoodsPicture(gdGoodsPicture);
    }

    /**
     * 修改商品图片关联
     * 
     * @param gdGoodsPicture 商品图片关联
     * @return 结果
     */
    @Override
    public int updateGdGoodsPicture(GdGoodsPicture gdGoodsPicture)
    {
        return gdGoodsPictureMapper.updateGdGoodsPicture(gdGoodsPicture);
    }

    /**
     * 批量删除商品图片关联
     * 
     * @param ids 需要删除的商品图片关联主键
     * @return 结果
     */
    @Override
    public int deleteGdGoodsPictureByIds(Long[] ids)
    {
        return gdGoodsPictureMapper.deleteGdGoodsPictureByIds(ids);
    }

    /**
     * 删除商品图片关联信息
     * 
     * @param id 商品图片关联主键
     * @return 结果
     */
    @Override
    public int deleteGdGoodsPictureById(Long id)
    {
        return gdGoodsPictureMapper.deleteGdGoodsPictureById(id);
    }

    /**
     * 根据商品id删除商品图片关联信息
     *
     * @param goodsId 商品ID
     * @return 结果
     */
    @Override
    public int deleteGdGoodsPictureByGoodsId(Long goodsId) {
        return gdGoodsPictureMapper.deleteGdGoodsPictureByGoodsId(goodsId);
    }
}
